<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Flow-IPC: ipc::transport::struc::Channel_base::Serialize_via_session_shm Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Flow-IPC<span id="projectnumber">&#160;2.0.0</span>
   </div>
   <div id="projectbrief">Flow-IPC project: Full implementation reference.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceipc.html">ipc</a></li><li class="navelem"><a class="el" href="namespaceipc_1_1transport.html">transport</a></li><li class="navelem"><a class="el" href="namespaceipc_1_1transport_1_1struc.html">struc</a></li><li class="navelem"><a class="el" href="classipc_1_1transport_1_1struc_1_1Channel__base.html">Channel_base</a></li><li class="navelem"><a class="el" href="structipc_1_1transport_1_1struc_1_1Channel__base_1_1Serialize__via__session__shm.html">Serialize_via_session_shm</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">ipc::transport::struc::Channel_base::Serialize_via_session_shm Struct Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Tag type for ctor selection: Backing RAM for serialization comes from a given <a class="el" href="classipc_1_1session_1_1Session.html" title="A documentation-only concept defining the local side of an IPC conversation (session) with another en...">session::Session</a>'s SHM arena (of per-session scope) via exponential-growing-size segment allocation(s).  
 <a href="structipc_1_1transport_1_1struc_1_1Channel__base_1_1Serialize__via__session__shm.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="channel__base_8hpp_source.html">channel_base.hpp</a>&gt;</code></p>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >Tag type for ctor selection: Backing RAM for serialization comes from a given <a class="el" href="classipc_1_1session_1_1Session.html" title="A documentation-only concept defining the local side of an IPC conversation (session) with another en...">session::Session</a>'s SHM arena (of per-session scope) via exponential-growing-size segment allocation(s). </p>
<p >Subsequent deserialization in the opposing process occurs from directly within the same backing RAM area(s). Therefore the serialization is <em>never</em> copied, period; only a short handle is internally copied into and out of the <code>Owned_channel</code> transport. Conversely, the opposing process does the same as the sender, and we do the converse as the receiver. I.e., this mode <em>is</em> zero-copy, in both directions. <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel__base_1_1Serialize__via__session__shm.html" title="Tag type for ctor selection: Backing RAM for serialization comes from a given session::Session&#39;s SHM ...">Serialize_via_session_shm</a> is usable only within the <a class="el" href="namespaceipc_1_1session.html" title="Flow-IPC module providing the broad lifecycle and shared-resource organization – via the session conc...">ipc::session</a> framework; if you are operating outside it then use the <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html" title="Owning and wrapping a pre-connected transport::Channel peer (an endpoint of an established channel ov...">struc::Channel</a> ctor form wherein the builder/reader engines are supplied as args.</p>
<p >More specifically, as of this writing: If the <code>Session</code> type in tag-form <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html" title="Owning and wrapping a pre-connected transport::Channel peer (an endpoint of an established channel ov...">struc::Channel</a> ctor is <a class="el" href="classipc_1_1session_1_1shm_1_1classic_1_1Server__session.html" title="Identical to session::Server_session in every way, except that it makes available two SHM arenas,...">session::shm::classic::Server_session</a> or <a class="el" href="namespaceipc_1_1session_1_1shm_1_1classic.html#ac6c443a72e0f22710c83bb1e8c229618" title="This is to session::Client_session what shm::classic::Server_session is to session::Server_session.">session::shm::classic::Client_session</a>, then <a class="el" href="namespaceipc_1_1transport_1_1struc_1_1shm_1_1classic.html#abfde278018c84aa1542475e9a4089c29" title="Convenience alias: transport::struc::shm::Builder that works with boost.ipc.shm pools from ipc::shm::...">shm::classic::Builder</a> and <a class="el" href="namespaceipc_1_1transport_1_1struc_1_1shm_1_1classic.html#af94f8698ca62a84d6366aaa931375d41" title="Convenience alias: transport::struc::shm::Reader that works with boost.ipc.shm pools from ipc::shm::c...">shm::classic::Reader</a> are the [de]serialization engines used. If the <code>Session</code> type in tag-form <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html" title="Owning and wrapping a pre-connected transport::Channel peer (an endpoint of an established channel ov...">struc::Channel</a> ctor is <a class="el" href="classipc_1_1session_1_1shm_1_1arena__lend_1_1jemalloc_1_1Server__session.html" title="Identical to session::Server_session in every way, except that it makes available two SHM arenas,...">session::shm::arena_lend::jemalloc::Server_session</a> or <a class="el" href="namespaceipc_1_1session_1_1shm_1_1arena__lend_1_1jemalloc.html#a837b4566cb2a734eb0ba58f285d084fe" title="This is to session::Client_session what shm::arena_lend::jemalloc::Server_session is to session::Serv...">session::shm::arena_lend::jemalloc::Client_session</a>, then <a class="el" href="namespaceipc_1_1transport_1_1struc_1_1shm_1_1arena__lend_1_1jemalloc.html#a95831556fc3cacf93de0bc96f4db3e13" title="Convenience alias: transport::struc::shm::Builder that works with SHM-jemalloc arenas.">shm::arena_lend::jemalloc::Builder</a> and <a class="el" href="namespaceipc_1_1transport_1_1struc_1_1shm_1_1arena__lend_1_1jemalloc.html#a94304eb7db7c7d7c8df1ff8aa3806913" title="Convenience alias: transport::struc::shm::Reader that works with SHM-jemalloc arenas.">shm::arena_lend::jemalloc::Reader</a> are the [de]serialization engines used. The source arena for our serialization (message building) comes from the <code>Session</code> impl supplied nearby in the ctor call; specifically its <code>.session_shm()</code> arena.</p>
<p >For concision, and to compile successfully, use the <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html" title="Owning and wrapping a pre-connected transport::Channel peer (an endpoint of an established channel ov...">struc::Channel</a> alias class template: <a class="el" href="namespaceipc_1_1transport_1_1struc_1_1shm_1_1classic.html#ac543b500a85f556564e592cbbefb6185" title="Convenience alias: Use this when constructing a struc::Channel with tag Channel_base::S_SERIALIZE_VIA...">shm::classic::Channel</a> or <a class="el" href="namespaceipc_1_1transport_1_1struc_1_1shm_1_1arena__lend_1_1jemalloc.html#ab68a69ad42d97d754f4e77c8cadd3a5e" title="Convenience alias: Use this when constructing a struc::Channel with tag Channel_base::S_SERIALIZE_VIA...">shm::arena_lend::jemalloc::Channel</a>.</p>
<h2>Relative benefits/limitations </h2>
<h3>As compared to <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel__base_1_1Serialize__via__heap.html" title="Tag type for ctor selection: Backing memory for serialization comes from fixed-size segment allocatio...">Serialize_via_heap</a></h3>
<p >Essentially they are the inverse of those of <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel__base_1_1Serialize__via__heap.html" title="Tag type for ctor selection: Backing memory for serialization comes from fixed-size segment allocatio...">Serialize_via_heap</a> above.</p>
<h3><a class="el" href="namespaceipc_1_1transport_1_1struc_1_1shm_1_1classic.html#ac543b500a85f556564e592cbbefb6185" title="Convenience alias: Use this when constructing a struc::Channel with tag Channel_base::S_SERIALIZE_VIA...">shm::classic::Channel</a> versus <a class="el" href="namespaceipc_1_1transport_1_1struc_1_1shm_1_1arena__lend_1_1jemalloc.html#ab68a69ad42d97d754f4e77c8cadd3a5e" title="Convenience alias: Use this when constructing a struc::Channel with tag Channel_base::S_SERIALIZE_VIA...">shm::arena_lend::jemalloc::Channel</a></h3>
<p >The relative merits of the two SHM providers (SHM-classic versus SHM-jemalloc) in <a class="el" href="namespaceipc_1_1shm.html" title="Modules for SHared Memory (SHM) support.">ipc::shm</a> are discussed within that namespace's docs. Short version:</p><ul>
<li>SHM-jemalloc is intended for safety (due to its asymmetrical internally-IPC-using nature) and efficiency of allocation (jemalloc is an industry-strength <code>malloc()</code> impl, which we've adapted to SHM use; whereas SHM-classic uses boost.ipc's relatively rudimentary default allocation algorithm (e.g., it does not do thread caching)). </li>
</ul>

<p class="definition">Definition at line <a class="el" href="channel__base_8hpp_source.html#l00114">114</a> of file <a class="el" href="channel__base_8hpp_source.html">channel_base.hpp</a>.</p>
</div><hr/>The documentation for this struct was generated from the following file:<ul>
<li>transport/struc/<a class="el" href="channel__base_8hpp_source.html">channel_base.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 11 2025 20:02:27 for Flow-IPC by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>
